<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Datetime - Multiple</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
    <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
    <style>
      .grid {
        display: flex;
        flex-wrap: wrap;
      }

      .grid-item {
        margin-bottom: 20px;
        margin-right: 20px;
      }

      h2 {
        font-size: 12px;
        font-weight: normal;

        color: #6f7378;

        margin-top: 10px;
        margin-left: 5px;
      }

      ion-datetime {
        box-shadow: 0px 8px 16px 0 rgba(0, 0, 0, 0.25);
        border-radius: 8px;
      }
    </style>
  </head>

  <body>
    <ion-app>
      <ion-header translucent="true">
        <ion-toolbar>
          <ion-title>Datetime - Multiple</ion-title>
        </ion-toolbar>
      </ion-header>
      <ion-content class="ion-padding">
        <div class="grid">
          <div class="grid-item">
            <h2>No Default Value</h2>
            <ion-datetime locale="en-US" id="noDefaultValue" presentation="date" multiple="true"></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>Single Default Value</h2>
            <ion-datetime
              locale="en-US"
              id="singleDefaultValue"
              presentation="date"
              multiple="true"
              value="2022-06-01"
            ></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>Multiple Default Values</h2>
            <ion-datetime locale="en-US" id="multipleDefaultValues" presentation="date" multiple="true"></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>Multiple Default Values - Separate Months</h2>
            <ion-datetime
              locale="en-US"
              id="multipleValuesSeparateMonths"
              presentation="date"
              multiple="true"
            ></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>Multiple=False, Array For Default Value</h2>
            <ion-datetime locale="en-US" id="multipleFalseArrayValue" presentation="date"></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>With Buttons</h2>
            <ion-datetime
              locale="en-US"
              id="withButtons"
              presentation="date"
              multiple="true"
              value="2022-06-01"
              show-default-buttons="true"
              show-clear-button="true"
            ></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>With Header</h2>
            <ion-datetime
              locale="en-US"
              id="withHeader"
              presentation="date"
              multiple="true"
              value="2022-06-01"
              show-default-title="true"
            ></ion-datetime>
          </div>
          <div class="grid-item">
            <h2>With Header, Custom Formatter</h2>
            <ion-datetime
              locale="en-US"
              id="customFormatter"
              presentation="date"
              multiple="true"
              value="2022-06-01"
              show-default-title="true"
            ></ion-datetime>
          </div>
        </div>
      </ion-content>
    </ion-app>

    <script>
      document.querySelector('#multipleDefaultValues').value = ['2022-06-01', '2022-06-02', '2022-06-03'];
      document.querySelector('#multipleValuesSeparateMonths').value = ['2022-04-01', '2022-05-01', '2022-06-01'];
      document.querySelector('#multipleFalseArrayValue').value = ['2022-06-01', '2022-06-02', '2022-06-03'];

      const customFormatterDatetime = document.querySelector('#customFormatter');
      customFormatterDatetime.value = ['2022-06-01', '2022-06-02', '2022-06-03'];
      customFormatterDatetime.titleSelectedDatesFormatter = (selectedDates) => `Selected: ${selectedDates.length}`;
    </script>
  </body>
</html>
